package com.ntschy.sys.entity.dto.role;

import com.ntschy.common.core.entity.enums.SysRoleMenuCheckStrictlyEnum;
import com.ntschy.sys.entity.valid.SysRoleGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author ezreal_geng
 */
@Data
@ApiModel(description = "角色新增更新dto")
public class SysRoleAddUpdateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色ID")
    @NotBlank(message = "角色ID不能为空", groups = SysRoleGroups.Update.class)
    @Length(min = 36, max = 36, message = "菜单ID长度不合法", groups = SysRoleGroups.Update.class)
    private String id;

    @ApiModelProperty(value = "角色名称")
    @NotBlank(message = "角色名称不能为空", groups = {SysRoleGroups.Add.class, SysRoleGroups.Update.class} )
    private String name;

    @ApiModelProperty(value = "角色权限字符")
    @NotBlank(message = "角色权限字符不能为空", groups = {SysRoleGroups.Add.class, SysRoleGroups.Update.class} )
    private String roleKey;

    @ApiModelProperty(value = "角色排序")
    @NotNull(message = "角色排序不能为空", groups = {SysRoleGroups.Add.class, SysRoleGroups.Update.class} )
    private Integer roleSort;

    @ApiModelProperty(value = "菜单树选择项是否关联显示（ 0：父子不互相关联显示 1：父子互相关联显示）")
    private SysRoleMenuCheckStrictlyEnum menuCheckStrictly;

    @ApiModelProperty(value = "菜单组")
    private String[] menuIds;

    @ApiModelProperty(value = "备注")
    private String remark;
}
